<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body></body>
  <script>
    //   通过构造函数创建对象
    function User(name) {
      this.name = name;
      this.show = function () {
        console.log(this.name);
      };
    }
    let xh=new User('刘辉')
    console.log(xh);
    
    let func=xh.show;
    // 此时show方法中的this指向的是windows
  </script>
</html>
